package com.example.onlinetaxi.ui.activity.StartToEndPage;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.onlinetaxi.R;
import com.example.onlinetaxi.Thread.PassengerGetOrderStateThread;
import com.example.onlinetaxi.ui.activity.CommentPage.CommentActivity;

public class PassengerArrivedFragment extends Fragment {

    private View rootView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_passenger_arrived, container, false);

        // 添加线程，检查订单是否已经完成
        // 订单结束后切换到评价界面，为司机进行打分
        PassengerGetOrderStateThread.finished = false;
        PassengerGetOrderStateThread.thread = new Thread(new PassengerGetOrderStateThread.GetCompletedOrderState(getActivity(), CommentActivity.class));
        PassengerGetOrderStateThread.thread.start();

        return rootView;
    }
}